package com.orangelife.mobile.complaints.biz;

import com.curry.android.http.OrangeDataHandler;
import com.curry.android.http.OrangeErrorHandler;
import com.curry.android.http.VolleyHttpUtil;
import com.google.gson.reflect.TypeToken;
import com.orangelife.mobile.constants.Constant;

import org.json.JSONObject;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;


/**
 * 获取某小区的栋座单元
 * Created by heyc on 2016/5/16.
 */
public class HouseHttpBiz {

    //字段目前为空
    static final String URL_DEPARTMENT_LIST=null ;

        public static void getDepartmentList(String communityName, String desc,  VolleyHttpUtil.ResponseCallBack callback, int pageNo, int pageSize) {
            VolleyHttpUtil.getInstance().cancel("TAG_COMM_LIST");
            HashMap<String, String> map = new HashMap<>();
            map.put("pageIndex", String.valueOf(pageNo));
            map.put("pageSize", String.valueOf(pageSize));
            map.put("desc", desc);
            map.put("communityName", communityName);
            VolleyHttpUtil.getInstance().getWithCallback(URL_DEPARTMENT_LIST, map, callback, "TAG_DEPA_LIST");
        }

        public static List<Map<String, Object>> handleDepartmentList(JSONObject response) {
            List<Map<String, Object>>list = new ArrayList<>();
            if (OrangeErrorHandler.getInstance().isSuccess(response)) {
                list = OrangeDataHandler.getListFromJsonWithPageEntity(
                        response, new TypeToken<List<Map<String, Object>>>() {
                        }.getType(), null, null);
            }
            return list;
        }


    }
